<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<base href="<%=basePath%>">
		<meta charset="utf-8" />
		<title></title>
        <link rel="stylesheet" href="front/css/scrollBar.css">
	    <link rel="stylesheet" href="front/css/normal.css">
	    <link rel="stylesheet" href="front/content/css/projectAdm.css"> 
	</head>
<body>
	<form action="boapply/saveApply.do" name="Form" id="Form" method="post">
		<input type="hidden" name="filiale_id" id="filiale_id" value="${pd.filiale_id}"/>
		<input type="hidden" name="task_id" id="task_id" value="${act.taskId}"/>
		<input type="hidden" name="procIns_id" id="procIns_id" value="${act.procInsId}"/>
		<input type="hidden" name="flag" id="flag" value="${act.flag}"/>
		<input type="hidden" name="task_def_key" id="task_def_key" value="${act.taskDefKey}"/>
		<div class="boxStyle">
			<p class="con-title">分公司申请</p>
				<table class="applyTable">
				      <colgroup>
			        		<col width='10%'>
			        		<col width='40%'>
			        		<col width='10%'>
			        		<col width='40%'>
	        	     </colgroup>
	        	     <tbody>
					<tr>
						<td style="width:150px;text-align:right;">公司名称:</td>
						<td>${pd.filiale_apply_name}</td>
					</tr>
					
						<tr>
						<td style="text-align:right;">申请人:</td>
						<td >${pd.filiale_apply_applicant }</td>
					</tr> 
					<tr>
						<td style="text-align:right;">业务范围:</td>
						<td >${pd.preparing_for_business }</td>
					</tr>
					<tr>
						<td style="text-align:right;">您的意见:</td>
						<td colspan="3"><textarea id="comment" name="comment" rows="5" style="width:600px;outline:none;resize:none;" ></textarea></td>
					</tr>
					</tbody>
				</table>
					<p class="btn-box">
			        	<a onclick="agree()" class='bgcolor'>同 意</a>
			        	<a onclick="noagree()" class='graycolor'>驳 回</a>
						<a onclick="javascript:history.back(-1);"  class='graycolor'>返回</a>
	                </p>
		</div>
		</form>
		<div style="height: 20px;"></div>
		<div class="boxStyle">
		      <p class="con-title">联系人信息</p>
		<table id="table_report" class="table table-striped table-bordered table-hover">
		         <colgroup>
			        		<col width='10%'>
			        		<col width='40%'>
			        		<col width='10%'>
			        		<col width='40%'>
			        		<col width='10%'>
			        		<col width='40%'>
			        		<col width='10%'>
			        		<col width='40%'>
	        	     </colgroup>
			<tr>
				<td>联系人姓名:</td>
				<td>${pd.related_name}</td>
				<td>身份证号码:</td>
				<td>${pd.id_card}</td>
			</tr>
			<tr>
				<td>联系电话:</td>
				<td>${pd.related_phone}</td>
				<td>身份证正面:</td>
				<td><img src="${pd.front_of_id_card}"></td>
			</tr>
			<tr>
				<td>身份证反面:</td>
				<td><img src="${pd.id_card_negative}"></td>
				<td>户籍证明:</td>
				<td><img src="${pd.household_register}"></td>
			</tr>
			<tr>
				<td>银行资信证明:</td>
				<td><img src="${pd.bank_prove}"></td>
			</tr>
		</table>
		</div>
		<div class="boxStyle" style="padding-bottom: 30px;">
    	   <p class="con-title" style="margin-top:60px;">分公司申请</p>
		    <table  class="cheshen">
		          <colgroup>
			                <col width="10%">
			                <col width="10%">
			                <col width="15%">
			                <col width="15%">
			                <col width="25%">
			                <col width="25%">
			        </colgroup>
					<tr><th>执行环节</th><th>执行人</th><th>开始时间</th><th>结束时间</th><th>提交意见</th><th>任务历时</th></tr>
					<c:forEach items="${varList}" var="act">
						<tr>
							<td>${act.histIns.activityName}</td>
							<td>${act.assigneeName}</td>
							<td><fmt:formatDate value="${act.histIns.startTime}" type="both"/></td>
							<td><fmt:formatDate value="${act.histIns.endTime}" type="both"/></td>
							<td style="word-wrap:break-word;word-break:break-all;">${act.comment}</td>
							<td>${act.durationTime}</td>
						</tr>
					</c:forEach>
				</table>
			</div>
	
				<div  class="boxStyle">
			        <p class="con-title" style="margin-top:60px;">流程审批图</p>
			        <div id="apply_image" style="text-align: center;padding:40px 0">
			           <iframe src="<%=basePath%>act/diagram-viewer?processDefinitionId=${act.procDefId }&processInstanceId=${act.procInsId}" frameborder="0" allowtransparency="true" onload="setIframeHeight(this)"></iframe> 
			        </div>
		       </div>
	    <script src="front/js/jquery-2.0.3.min.js"></script>
        <script src="front/js/index.js"></script>
		<script type="text/javascript">
		function agree(){
			$('#flag').val('yes');
			$.ajax({
				type: "POST",
				url: $("#Form").attr("action"),
		    	data: $("#Form").serialize(),
				dataType:'json',
				cache: false,
				success: function(data){
					if(data.msg == "success"){
						alert("审批成功!");
						location.href = "<%=basePath%>acttask/todo.do";
					}
				}
			});
		}
		
		function noagree(){
			$('#flag').val('no');
			$.ajax({
				type: "POST",
				url: $("#Form").attr("action"),
		    	data: $("#Form").serialize(),
				dataType:'json',
				cache: false,
				success: function(data){
					if(data.msg == "success"){
						alert("驳回成功!");
						location.href = "<%=basePath%>acttask/todo.do";
					}
				}
			});
		}
		
		$(top.hangge());
		$(function() {
			
			//单选框
			$(".chzn-select").chosen(); 
			$(".chzn-select-deselect").chosen({allow_single_deselect:true}); 
			
			//日期框
			$('.date-picker').datepicker();
		});
		
		</script>
</body>
</html>